# SONIX DSP Makefile Version:1.0.0.2
# Defination
COMPILER	=	"C:\Sonix\SN8_C_~1.076\Bin\Build\SN8cc.exe"
EZCOMPILER	=	
GMA			=	"C:\Sonix\SN8_C_~1.076\Bin\Build\gma.exe"
GENINS		=	"C:\Sonix\SN8_C_~1.076\Bin\Build\genins.exe"
RUN			=	"C:\Sonix\SN8_C_~1.076\Bin\Build\RunProcess.exe"
LINKER		=	"C:\Sonix\SN8_C_~1.076\Bin\Build\slink.exe"
POSTLINKER	=	"C:\Sonix\SN8_C_~1.076\Bin\Build\spostlink.exe"
CONVERT		=	"C:\Sonix\SN8_C_~1.076\Bin\Build\RcvSN8.exe"

# Define Path Macro
PRJ_PATH=.
OBJ_PATH=.\Obj
INC_PATH=
LIB_PATH=
C_INC_PATH=C:\Sonix\SN8_C_~1.076\C\MCU\SN8\include
OUT_PATH=.
VPATH=.\:$(OBJ_PATH):$(LIB_PATH):$(INC_PATH):$(C_INC_PATH):$(OUT_PATH)

# Define Option Flags
COMPILER_FLAGS = -target=SN8P2711B -INI="C:\Sonix\SN8_C_~1.076\Bin\Build\SN8P2700A.ini" -PROJECTNAME=".\Test.prj" -WL=3 -Chip_Series=2 -A -g -IC:\Sonix\SN8_C_~1.076\C\MCU\SN8\include -NoMUL -PUSH2 -NoCALLHL -NoGlobalOpt -tempdir="$(OBJ_PATH)"  -cpp_skip_asm -DICE_Mode=0
EZCOMPILER_FLAGS = /MACHINE:SN8P2711B /INI:"SN8P2700A.ini" /OutputPath:"$(OBJ_PATH)"  /WL:3
GMA_FLAGS	=	/INI:"SN8P2700A.ini" /ID1:0 /ID2:0  /MACHINE:SN8P2711B /Chip_Series:2 /PROJECTNAME:".\Test.prj" /WL:3 /LISTFILE:  /DEFINE:ICE_Mode=0 /DEFINE:SN8P2711B=1  /OutputPath:"$(OBJ_PATH)" 
GENINS_FLAGS = /MACHINE:SN8P2711B
LINK_FLAGS	=	/MACHINE:SN8P2711B /Chip_Series:2 /INI:"SN8P2700A.ini" /WL:3 /OutputFile:"$(OUT_PATH)/Test.out"  /MAP:"$(OBJ_PATH)\Obj"   /STDLIB:".\Obj"    /STACK: /PROJECTNAME:".\Test.prj" 
CONV_FLAGS	=	/MACHINE:SN8P2711B /INI:"SN8P2700A.ini" /WL:3 /OutputFile:"$(OUT_PATH)/Test.sn8"  /PROJECTNAME:".\Test.prj" /IDSVersion:V1.18.175.076n /Chip_Series:2 /OSLIB:".\Obj"  
LINK_DEP_FILES=	$(OBJ_PATH)\main.o

# Define Rule
$(OBJ_PATH)\main.asm: .\main.c $(C_INC_PATH)\SN8P2711B.h $(PRJ_PATH)\Test.cfg
	@$(COMPILER) $(COMPILER_FLAGS) -o $@ $^ 

$(OBJ_PATH)\main.o: $(OBJ_PATH)\main.asm $(PRJ_PATH)\Test.cfg C:\Sonix\SN8_C_~1.076\C\MCU\SN8\include\sn8cc_macros.asm C:\Sonix\SN8_C_~1.076\Lib\MCU\SN8P27~1\Shared\MACRO1.H C:\Sonix\SN8_C_~1.076\Lib\MCU\SN8P27~1\Shared\MACRO2.H C:\Sonix\SN8_C_~1.076\Lib\MCU\SN8P27~1\Shared\MACRO3.H .\Obj\main.asm.dat
	@$(GMA) $(GMA_FLAGS) /CSource: /CASE: $< 

$(OUT_PATH)\Test.sn8: $(OUT_PATH)\Test.out $(PRJ_PATH)\Test.cop
	@$(CONVERT) $(CONV_FLAGS) $^ 

$(OUT_PATH)\Test.out: $(LINK_DEP_FILES) $(PRJ_PATH)\Test.cop
	@$(LINKER) $(LINK_FLAGS) /CSource: /CASE: $(LINK_DEP_FILES) 

# Define Clean Rule
Clean:

	@del /F /Q $(OBJ_PATH)\*.*;
	@if EXIST $(OUT_PATH)\Test.out del $(OUT_PATH)\Test.out;
	@if EXIST $(OUT_PATH)\Test.sn8 del $(OUT_PATH)\Test.sn8;


# Don't keep invalid files, command line must return non-zero(1 or 2) value
# to validate delete on error mechanism
# else return 0 for success
.DELETE_ON_ERROR:

Begin:
	
Build: Begin All

Rebuild: Clean Build

All:$(OUT_PATH)\Test.out $(OUT_PATH)\Test.sn8

